package test.motion {
	import gear.core.Game;
	import gear.motion.GEase;
	import gear.motion.GLayoutTween;
	import gear.motion.GOffsetTween;
	import gear.motion.GPropTween;
	import gear.motion.easing.Back;
	import gear.motion.easing.Regular;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.containers.GPanel;
	import gear.ui.core.GAlign;
	import gear.ui.data.GPanelData;

	import flash.events.Event;

	/**
	 * @author admin
	 */
	[SWF(width=1000,height=570,backgroundColor=0x333333,frameRate=48)]
	public class TestLayoutTween extends Game {
		override protected function startup() : void {
			RESManager.instance.add(new SWFLoader(new LibData("assets/ui.swf")));
			RESManager.instance.addEventListener(Event.COMPLETE, completeHandler);
			RESManager.instance.load();
		}

		private function completeHandler(event : Event) : void {
			var showEase : GEase = new GEase();
			showEase.add(new GLayoutTween(new GAlign(-320, -1, -1, -1, -1, 0), new GAlign(-1, -1, -1, -1, -80, 0), 10, Regular.easeIn));
			showEase.add(new GOffsetTween(GPropTween.X, 0, 80, 10, Back.easeOut, 10));
			var data : GPanelData = new GPanelData();
			data.parent = this;
			data.width = 320;
			data.height = 400;
			data.showEffect = showEase;
			data.x = -data.width;
			var panel : GPanel = new GPanel(data);
			panel.show();
		}
	}
}
